package prototype;

import java.util.Hashtable;

public class shapeCache {
  private static Hashtable<String,shape> shapeMap =  new Hashtable<String,shape>();

  public static shape getShape(String shapeId){
      shape shapeCache = shapeMap.get(shapeId);
      return (shape) shapeCache.clone();
  }

  public static void loadCache(){
      circle circle = new circle();
      circle.setId("1");
      shapeMap.put(circle.getId(),circle);
      rectangle rectangle = new rectangle();
      rectangle.setId("2");
      shapeMap.put(rectangle.getId(), rectangle);
  }
}
